TECCreateConverter
Creates a text encoding converter object and returns a reference to it.
pascal OSStatus TECCreateConverter ( TECObjectRef *newEncodingConverter, TextEncoding inputEncoding, TextEncoding outputEncoding);
newEncodingConverter
- A pointer to a converter object. On return, this reference points to the newly created text converter object.
inputEncoding
- The text encoding specification for the source text encoding.
outputEncoding
- The text encoding specification for the destination text encoding.
- function result
- A result code. See "Text Encoding Conversion Manager Result Codes" (page 42) for a list of possible values. If this function returns a result code other than
noErr
, then it did not successfully create the converter object reference. If the current configuration of the converter does not support either the source or destination encoding, the function returns akTextUnsupportedEncodingErr
result code.DISCUSSION
For a specified source encoding and destination encoding, TECCreateConverter determines a conversion path, creates a text encoding converter object, and returns a reference to it. You use this converter object reference with conversion functions such asTECConvertText
(page 95) to convert text. This converter object describes the source, destination, and intermediate encodings; state information; and references to required plug-ins.If no direct conversion path is found, then TECCreateConverter creates an indirect conversion automatically. You may also use the function
TECCreateConverterFromPath
(page 92) to explicitly specify a conversion path.To remove a converter object, you must call the function
TECDisposeConverter
(page 93).